﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;

namespace EmailValidation
{
    class Program
    {
        static void Main(string[] args)
        {
            string email = "ivans@abvab.asd.asd.adfa";

            Match match = Regex.Match(email, @"\A[a-zA-Z0-9_]+@([a-zA-Z0-9_]+\.)+[a-zA-Z]{2,4}\Z");
            if (match.Success) Console.WriteLine("Valid email");
            else Console.WriteLine("Invalid email");
        }
    }
}
